home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual Foxpro 6.0 (Ent. Edition) / Vf6ent Extractor.EXE / TOOLS / XSOURCE / XSOURCE.ZIP / vfpsource / Builders / wizard.prg < prev    next >
Encoding:
Text File  |  1998-05-01  |  3.5 KB  |  105 lines

  1. * Program:        WIZARD.PRG
  2. * Description:    Main program of Wizard.app
  3. * Written by:    John Alden (Alden Anderson, Inc.)
  4. * Version:        .071
  5.  
  6. * Parameters:
  7. *    wbcpClass    - class designation for wizards, eg "FORM", "REPORT"
  8. *    wbcpName    - name of specific wizard to run, correlates to "classname" or "program" fields in reg table
  9. *     wbcpOptions    - optional parameters - e.g. "NOSCRN", "MODIFY"
  10. *     wbcpP1-9    - optional parameters to pass to wizard
  11.  
  12. * Comments:
  13. *    Naming conventions used in wizard.prg, builder.prg, and wb.prg -
  14. *        - all variables begin with "wb"
  15. *        - the third character designates variable type
  16. *        - parameters have "p" as their fourth character, e.g. "wbcpOptions"
  17. * -----------------------------------------------------------------------------------------------------------------
  18.  
  19. PARAMETERS wbcpClass, wbcpName, wbcpOptions, wbcpP1, wbcpP2, wbcpP3, wbcpP4, wbcpP5, wbcpP6, wbcpP7, wbcpP8, wbcpP9
  20.  
  21. m.wbOptionalParms = parameters() - 3    && first 3 are known parameters, remainder are optional
  22.  
  23. #DEFINE C_WIZARD_LOC            "WIZARD"
  24.  
  25. * This section added to support calls to report wizard from screens generated by 2.6 form wizard - click on "Print",
  26. * calls wizard.app with incorrect parameters. Adjust parameters so that it becomes a call to the report wizard with
  27. * "autoformat".
  28.  
  29. IF TYPE("m.wbcpName") = "C" AND m.wbcpName = "WZ_QREPO"
  30.     m.wbcpName = "WZREPORT"
  31.     m.wbcpOptions = m.wbcpOptions + " NOTASK AUTOREPORT "
  32. ENDIF
  33.  
  34. m.wbStartingProc = SET("PROCEDURE")
  35.  
  36. IF NOT 'WBMAIN' $ SET("PROCEDURE")
  37.     SET PROCEDURE TO WBMAIN ADDITIVE                && main wizard/builder class library
  38. ENDIF
  39.  
  40. m.wbcWizVer = " version .071"
  41. m.wblError = .f.
  42. m.wbReturnValue = ""
  43.  
  44. m.wboObject = CREATEOBJ("wizard")            && create wizard object - class definition below
  45.  
  46. wboObject.wbOptParms = m.wbOptionalParms
  47.  
  48. wboObject.wblModal = .t.
  49. IF TYPE("wbcpOptions") = "C"
  50.     LOCAL cDate
  51.     m.cDate = SET('DATE')
  52.     SET DATE TO MDY
  53.     IF " SNOQUALMIE::FLEW " $ " " + UPPER(m.wbcpOptions) + " "
  54.         wboObject.wblModal = .f.
  55.     ENDIF
  56.     SET DATE TO &cDate
  57. ENDIF
  58.  
  59. wboObject.WBSaveEnvironment                && save environment
  60. wboObject.WBSetProps                    && set properties of the wizard object
  61. wboObject.WBCheckparms                    && verify parameters
  62. wboObject.WBCheckErrors                    && check for certain errors
  63. IF m.wblError
  64.     RETURN
  65. ENDIF
  66. wboObject.WBSetTools                    && load the tools library
  67. wboObject.WBSetPlatform                    && platform-specific code
  68.  
  69. wboObject.WBGetRegTable                    && locate registration table
  70. IF NOT EMPTY(wboObject.wbcRegTable)
  71.     wboObject.WBGetName                    && get name of wizard
  72.     IF NOT EMPTY(wboObject.wbcName)    
  73.         wboObject.WBCall                && call specific wizard
  74.     ENDIF
  75. ENDIF
  76.  
  77. IF wboObject.wblModal
  78.     wboObject.WBSetEnvironment                && restore environment if modal (else it's an automated test)
  79. ENDIF
  80. m.wbReturnValue = wboObject.wbReturnValue
  81. RELEASE wboObject
  82.  
  83. IF NOT EMPTY(m.wbStartingProc)
  84.     SET PROCEDURE TO &wbStartingProc
  85. ELSE
  86.     SET PROCEDURE TO
  87. ENDIF
  88.  
  89. RETURN m.wbReturnValue
  90.  
  91.  
  92.  
  93. DEFINE CLASS Wizard AS WizBldr        
  94. * --------------------------------------------------------------------------------------
  95. * The WizBldr parent class is defined in the WB.PRG class library. The wizard class is 
  96. * set up as a subclass as an opportunity for customizing wizards. Code overriding methods 
  97. * from the parent, for example, could go here.
  98. * --------------------------------------------------------------------------------------
  99.  
  100.     m.wbcType = "WIZARD"                && do not localize
  101.     m.wbcTypeDisplay = C_WIZARD_LOC        && this line is localizable, defined at top of this file
  102.     
  103. ENDDEFINE
  104.  
  105.